<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>服务台账-详细</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .model-picker-input {
            opacity: 0 !important;
            top: -9999px;
            left: -9999px;
            position: absolute;
        }

        .model-picker-span {
            position: relative;
            display: block;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            border-bottom: 1px solid #ccc;
            background-color: #fff;
            color: #ccc;
            cursor: pointer;
        }

        .model-picker-span > .placeholder {
            color: #aaa;
        }

        .model-picker-span > .arrow {
            position: absolute;
            top: 50%;
            right: 8px;
            width: 10px;
            margin-top: -3px;
            height: 5px;
            background: url(../images/drop-arrow.png) -10px -25px no-repeat;
        }

        .model-picker-span.focus,
        .model-picker-span.open {
            border-bottom-color: #46A4FF;
        }

        .model-picker-span.open > .arrow {
            background-position: -10px -10px;
        }

        .model-picker-span > .title > span {
            color: #333;
            padding: 5px;
            border-radius: 3px;
        }

        .model-picker-span > .title > span:hover {
            background-color: #f1f8ff;
        }

        .model-picker-dropdown {
            position: absolute;
            width: 315px;
            left: -9999px;
            top: -9999px;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            z-index: 999999;
            display: none;
            min-width: 200px;
            margin-bottom: 20px;
            margin-top: 5px;
        }

        .model-select-wrap {
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
        }

        .model-select-tab {
            border-bottom: 1px solid #ccc;
            background: #f5f5f5;
            /*font-size: 13px;*/
        }

        .model-select-tab > a {
            display: inline-block;
            padding: 4px 20px;
            border-left: 1px solid #ccc;
            border-bottom: 1px solid transparent;
            color: #4D4D4D;
            text-align: center;
            outline: 0;
            text-decoration: none;
            cursor: pointer;
            /*font-size: 14px;*/
            margin-bottom: -1px;
        }

        .model-select-tab > a.active {
            background: #fff;
            border-bottom: 1px solid #fff;
            color: #46A4FF;
        }

        .model-select-tab > a:first-child {
            border-left: none;
        }

        .model-select-tab > a:last-child.active {
            border-right: 1px solid #ccc;
        }

        .model-select-content {
            width: 100%;
            min-height: 50px;
            background-color: #fff;
            padding: 5px 5px;
        }

        .model-select {
            /*font-size: 16px;*/
        }

        .model-select dl {
            line-height: 2;
            clear: both;
            padding: 3px 0;
            margin: 0;
            max-height: 200px;
            overflow-y: scroll;
        }

        .model-select dt {
            position: absolute;
            width: 2.5em;
            font-weight: 500;
            text-align: right;
            line-height: 2;
        }

        .model-select dd {
            margin-left: 0;
            line-height: 2;
        }

        .model-select.province dd {
            margin-left: 3em;
        }

        .model-select a {
            display: inline-block;
            padding: 0 10px;
            outline: 0;
            text-decoration: none;
            white-space: nowrap;
            margin-right: 2px;
            color: #333;
            cursor: pointer;
        }

        .model-select a:hover,
        .model-select a:focus {
            background-color: #f1f8ff;
            border-radius: 2px;
            color: #46A4FF;
        }

        .model-select a.active {
            background-color: #46A4FF;
            color: #fff;
            border-radius: 2px;
        }

        .table-detail input[type=text] {
            padding-left: 4px;
        }
         .table-detail select {
            padding-left: 0px;
        }
        td {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }

        select {
            color: rgb(42, 140, 236) !important;
            background: #fff;
        }

        .table-detail td {
            /*font-size: 16px;*/
            line-height: 15px;
            height: 32px;
            border-right: 1px solid #cbcbcb;
            border-bottom: 1px solid #cbcbcb;
        }

        .table-detail td.td-title {
            line-height: 1.5;
            background: #F5F5F5;
        }

        .table-detail td.td-row3 {
            height: 70px;
            line-height: 20px;
            max-height: 70px;
            overflow: hidden;
            position: relative;
        }

        .yuying {
            position: absolute;
            right: 10px;
            bottom: 10px;
            width: 20px;
            height: 20px;
            background: url("/dist/img/yuyin.png");
            background-size: cover;
            cursor: pointer;
        }

        input {
            text-align: left !important;
        }

        .table-detail td.td-value {
            text-align: left !important;
            padding-left: 4px !important;
            /*font-size: 16px !important;*/
        }

        .btn-group-xs > .btn, .btn-xs {
            padding: 1px 5px;
            /*font-size: 16px;*/
            line-height: 1.5;
            border-radius: 3px;
        }

        .table-detail textarea {
            height: 60px;
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            line-height: 20px;
            padding-top: 2px !important;
            padding-left: 6px;
        }

        .td-row3 span {
            max-height: 60px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            text-align: left;

        }
        .selectOption{
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #fff;
            border: 1px solid #e8e8ea;
            display: none;
        }
        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .td-module td {
            color: black;
            font-weight: bold;
            background: yellow;
        }

        .table-detail {
            border-left: 1px solid #cbcbcb;
            border-top: 1px solid #cbcbcb;
        }

        .table-detail .td-module {
            background: yellow;
        }
        span.lineOne {
            line-height: 20px;
            height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }
        .table-detail td.td-value2{
            padding: 1px !important;
            text-align: left !important;
        }
        .td-value2 input{
            box-shadow: inset 1px 1px 4px #333;
            height:100% !important;
            padding-left:4px !important;
        }
        .td-value2 textarea{
            box-shadow: inset 1px 1px 4px #333;
            height:100% !important;
            padding-left:4px !important;
        }
        .td-value2 select{
            padding: 1px !important;
            box-shadow: inset 1px 1px 4px #333;
            height:100% !important;
            padding-left:0px !important;
        }
        .td-value2 span{
              padding-left:4px !important;
          }
        .span-a-btn {
            position: absolute;
            right: 10px;
        }
        .a-btn{
            color: black;
        }
        .jieQ td{
            color:#ddd!important;
        }
        .benYwJieQ td{
            color:red!important;
        }
        .wJieQ td{
            color:#333!important;
        }
        #divUploadedFiles2 .progressobj {
            height: 25px;
            line-height: 25px;
            margin-bottom: 2px;
            overflow: hidden;
        }
        #divUploadedFiles1 .progressobj {
            height: 25px;
            line-height: 25px;
            margin-bottom: 2px;
            overflow: hidden;
        }
        .title{
            background-color: yellow;
            color:black;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<div class="div-td-content-more"><i></i></div>
<section class="content" id="app" v-cloak style="padding:0px;">
    <div class="selectOption">
        <input style="margin:0;text-align: left;width: 100%;cursor: pointer;line-height: 24px;" v-if="item.repairOrderNumber" v-for="(item,i) in equipmentAccountEntity.fwWReportCusVisitEntity" @click="selectP(item.repairOrderNumber)" v-model="item.repairOrderNumber" />
    </div>
    <!--<div class="north" style="height:40px;"></div>-->
    <!--<h4 class="text-center" class="margin-top:10px;" >商务条件预申请</h4>-->
    <div class="center" style="overflow:auto;overflow-x:hidden;">
        <table class="table-detail">
            <tr class="td-module">
                <td colspan="8">基本信息</td>
            </tr>
            <tr>
                <td class="td-title" style="width:12.5%;">客户名称</td>
                <td   style="width:12.5%;" class="td-value2">
                    <!--<input type="text" v-if="pageType=='edit'" v-model="deviceInfo.customerName"/>-->
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.customerName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.customerName}}</span>
                </td>
                <td class="td-title" style="width:12.5%;">联系电话
                </td>
                <td  style="width:12.5%;" class="td-value2">
                    <!--<input type="text" v-if="pageType=='edit'" v-model="deviceInfo.customerTel"/>-->
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.customerTel}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.customerTel}}</span>
                </td>
                <td class="td-title" style="width:12.5%;">实际购车人名称</td>
                <td  class="td-value2" style="width:12.5%;">
                    <!--<input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.actualCarBuyer"/>-->
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.actualCarBuyer}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.actualCarBuyer}}</span>
                </td>
                <td class="td-title" style="width:12.5%;">实际购车人联系电话</td>
                <td class="td-value2" style="width:12.5%;">
                    <!--<input type="text" v-if="pageType=='edit'" v-model="deviceInfo.actualCarBuyerTel"/>-->
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.actualCarBuyerTel}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.actualCarBuyerTel}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">合作类型
                </td>
                <td  class="td-value2">
                    <select v-if="pageType=='edit'" type="text" v-model="equipmentAccountEntity.deviceInfo.cooperationType">
                        <option v-for="option in cooperationType" :value="option.value">{{option.text}}</option>
                    </select>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.cooperationType}}</span>
                </td>
                <td class="td-title">客户类型
                </td>
                <td  class="td-value2">
                    <select v-if="pageType=='edit'" type="text" v-model="equipmentAccountEntity.deviceInfo.accountCustomerType">
                        <option v-for="option in customerType" :value="option.value">{{option.text}}</option>
                    </select>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.accountCustomerType}}</span>
                </td>
                <td class="td-title">管理员姓名
                </td>
                <td  class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.administratorName"/>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.administratorName}}</span>
                </td>
                <td class="td-title">管理员电话
                </td>
                <td  class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.administratorPhone"/>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.administratorPhone}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">操作员姓名</td>
                <td  class="td-value2" colspan="3">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.operatorName"/>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.operatorName}}</span>
                </td>
                <td class="td-title">操作员电话</td>
                <td  class="td-value2" colspan="3">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.operatorPhone"/>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.operatorPhone}}</span>
                </td>
            </tr>
        </table>
        <table class="table-detail">
            <tr class="td-module" >
                <td colspan="8">设备信息</td>
            </tr>
            <tr>
                <td class="td-title" style="width:12.5%;">交机日期
                </td>
                <td  style="width:12.5%;" class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.deliveryDate}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.deliveryDate}}</span>
                </td>
                <td class="td-title" style="width:12.5%;">交机地址
                </td>
                <td  style="width:12.5%;" class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.deliveryAddress}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.deliveryAddress}}</span>
                </td>
                <td class="td-title" style="width:12.5%;">区域</td>
                <td  class="td-value2" style="width:12.5%;">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.regionName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.regionName}}</span>
                </td>
                <td class="td-title" style="width:12.5%;">区域经理
                </td>
                <td  class="td-value2" style="width:12.5%;">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.regionManagerName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.regionManagerName}}</span>
                </td>
            </tr>

            <tr>
                <td class="td-title">服务人员
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.servicePersonnel" id="customer"/>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.servicePersonnel}}</span>
                </td>
                <td class="td-title">大区经理</td>
                <td class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.bigregionManagerName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.bigregionManagerName}}</span>
                </td>
                <td class="td-title">品牌</td>
                <td  class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.brandName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.brandName}}</span>
                </td>
                <td class="td-title">设备类型
                </td>
                <td  class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.deviceTypeName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.deviceTypeName}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">型号</td>
                <td  class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.modelName}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.modelName}}</span>
                </td>
                <td class="td-title">序列号</td>
                <td  class="td-value2">
                    <span v-if="pageType=='edit'" class="pull-left">{{equipmentAccountEntity.deviceInfo.sequence}}</span>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.sequence}}</span>
                </td>
                <td class="td-title">发动机号</td>
                <td  class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.engineNumber"/>

                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.engineNumber}}</span>
                </td>
                <td class="td-title">质保状态</td>
                <td  class="td-value2">
                    <select v-if="pageType=='edit'" type="text" v-model="equipmentAccountEntity.deviceInfo.warrantyState">
                        <option v-for="option in warrantState" :value="option.value">{{option.text}}</option>
                    </select>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.warrantyState}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">设备来源</td>
                <td  class="td-value2" colspan="3">
                    <select v-if="pageType=='edit'" type="text" v-model="equipmentAccountEntity.deviceInfo.deviceSource">
                        <option v-for="option in deviceSourceList" :value="option.value">{{option.text}}</option>
                    </select>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.deviceSource}}</span>
                </td>
                <td class="td-title">预计下次服务日期</td>
                <td  class="td-value2" colspan="3">
                    <input type="text" v-if="pageType=='edit'" v-model="equipmentAccountEntity.deviceInfo.nextServiceDate" placeholder="选择日期" @focus="showDatePicker($event,'nextServiceDate','deviceInfo')"/>
                    <span v-else class="lineOne">{{equipmentAccountEntity.deviceInfo.nextServiceDate}}</span>
                </td>
            </tr>
        </table>
        <table class="table-detail">
            <tr class="td-module">
                <td colspan="13">服务记录 <span class="span-a-btn" v-if="pageType=='edit'"> <a href="javascript:void(0);" class="a-btn"
                                                                   @click="addRow('fwWReportCusVisitEntity','equipmentAccountEntity')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('fwWReportCusVisitEntity')">删除一行</a></span>
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width:80px;">服务日期</td>
                <td class="td-title" style="width:85px;">报修单号</td>
                <td class="td-title" style="width:85px;">服务类型</td>
                <td class="td-title" style="width:85px;">工况</td>
                <td class="td-title" style="width:85px">日均工作小时</td>
                <td class="td-title" style="width:85px">最新工作小时</td>
                <td class="td-title" >服务内容</td>
                <td class="td-title" style="width:69px">配件收费(元)</td>

                <td class="td-title" style="width:69px">工时收费(元)</td>
                <td class="td-title" style="width:85px">负责人</td>
                <td class="td-title" style="width:85px">状态</td>
                <td class="td-title" style="width:110px" >附件</td>
                <td class="td-title" style="width:85px" ></td>
            </tr>
            <tr  v-for="(item,i) in equipmentAccountEntity.fwWReportCusVisitEntity">
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.reportDate" placeholder="选择日期" @focus="showDatePicker($event,'reportDate',item)"/>
                    <span v-else class="lineOne">{{item.reportDate}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.repairOrderNumber"/>
                    <span v-else class="lineOne">{{item.repairOrderNumber}}</span>
                </td>
                <td class="td-value2">
                    <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                        <option value=""></option>
                        <option v-for="option in serverVisitType">
                            {{option.value}}
                        </option>
                    </select>
                    <span v-else class="lineOne">{{item.otherVisitType}}</span>
                </td>
                <td class="td-value2">

                    <select v-if="pageType=='edit'" v-model="item.fwWorkingCondition">
                        <option value=""></option>
                        <option v-for="option in workingCondition">
                            {{option.value}}
                        </option>
                    </select>
                    <span v-else class="lineOne">{{item.fwWorkingCondition}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.fwWorkingHoursAvg"/>
                    <span v-else class="lineOne">{{item.fwWorkingHoursAvg}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.fwLatestWorkingHours"/>
                    <span v-else class="lineOne">{{item.fwLatestWorkingHours}}</span>
                </td>
                <td class="td-value2">
                    <textarea  v-if="pageType=='edit'" v-model="item.serverCondition"></textarea>
                    <span v-else class="lineOne">{{item.serverCondition}}</span>
                </td>
                <td class="td-value2">
                    <input type="text"  v-if="pageType=='edit'" v-model="item.accessoriesChargesCondition"/>
                    <span v-else class="lineOne">{{item.accessoriesChargesCondition}}</span>
                </td>
                <td class="td-value2">
                    <input type="text"  v-model="item.hoursChargesCondition" v-if="pageType=='edit'"/>
                    <span v-else class="lineOne">{{item.hoursChargesCondition}}</span>
                </td>
                <td class="td-value2">
                   <input type="text"  v-model="item.principal"  class="txtParent" @click="onfocus1(i)" v-if="pageType=='edit'"/>
                    <span v-else class="lineOne">{{item.principal}}</span>
                </td>

                <td class="td-value2">
                    <select v-if="pageType=='edit'" type="text" v-model="item.fwState">
                        <option v-for="option in state" :value="option.value">{{option.text}}</option>
                    </select>
                    <span v-else class="lineOne">{{item.fwState}}</span>
                </td>
                <!--<td  style="position: relative">-->

                    <!--<div v-if="item.attachName" style="float:left;cursor: pointer;width: 80px"-->
                         <!--v-on:click="download(item.attachUrl,item.attachName)">-->
                        <!--<input v-if="item.attachName" type="button" class="IcoNormal"-->
                               <!--style="float:left;margin-top:6px"/>-->
                        <!--<span class="lineOne">{{item.attachName}}</span>-->
                    <!--</div>-->
                    <!--<div v-else style="float:left;cursor: pointer;"-->
                         <!--v-on:click="download(item.attachUrl,item.attachName)">-->
                        <!--<input v-if="item.attachName" type="button" class="IcoNormal"-->
                               <!--style="float:left;margin-top:6px"/>-->
                        <!--<span class="lineOne">{{item.attachName}}</span>-->
                    <!--</div>-->
                    <!--<div  style="position: absolute;right: 1px;top: 8px;">-->
                        <!--<a href="javascript:void(0);" v-if="pageType!='look'&&item.attachName"-->
                           <!--class="delfile" v-on:click="deleteFileRP(item,'fwWReportCusVisitEntity',i)"><span-->
                                <!--style="color: red;font-weight: bold;">X</span></a>-->
                    <!--</div>-->
                    <!--<div v-if="pageType!='look'&&!item.attachName" class="" :class="pageType=='look'?'fujian fj noFujian':'fujian fj'"-->
                         <!--:id="'fwWReportCusVisitEntity'+i">上传附件-->
                    <!--</div>-->

                <td class="td-row2 td-value1">
                    <div id="divUploadedFiles1">
                        <div v-for="(attach,index) in item.attaches" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer" v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename" style="float:left;cursor: pointer;width: 80px" v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                            <div class="delfile">
                                <span  v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);" style="color: red;font-weight: bold; !important;" @click="deleteFile5(item,'fwWReportCusVisitEntity',i,index)">X</a></span>
                            </div>
                        </div>
                    </div>
                </td>
                <td >
                    <div v-if="pageType!='look'" :id="'fwWReportCusVisitEntity'+i" class="rightBorder fj fujian">
                        上传附件
                    </div>
                </td>
            </tr>
        </table>
        <table class="table-detail">
            <tr class="td-module">
                <td colspan="15">索赔记录详情
                    <span class="span-a-btn" v-if="pageType=='edit'"><a href="javascript:void(0);" class="a-btn"
                                                @click="addRow('spWReportCusVisitEntity','equipmentAccountEntity')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('spWReportCusVisitEntity')">删除一行</a></span>

                </td>
            </tr>
            <tr>
                <td class="td-title" style="width:80px;">服务日期
                </td>
                <td class="td-title" style="width:85px;">报修单号
                </td>
                <td class="td-title" style="width:85px;">索赔类型
                </td>
                <td class="td-title" style="width:80px;">申请日期
                </td>
                <td class="td-title" style="width:69px;">索赔金额(元)
                </td>
                <td class="td-title" style="width:80px;">批复日期
                </td>
                <td class="td-title" style="width:69px;">批复金额(元)
                </td>
                <td class="td-title" style="width:80px;">到账日期
                </td>
                <td class="td-title" style="width:69px;">到账金额(元)
                </td>
                <td class="td-title" style="width:69px;">拒赔金额(元)
                </td>
                <td class="td-title" >拒赔原因
                </td>
                <td class="td-title" style="width:85px;">旧件情况
                </td>
                <td class="td-title" style="width:80px;">返厂日期
                </td>
                <td class="td-title" style="width:110px;">返厂运单附件
                </td>
                <td class="td-title" style="width:85px" ></td>
            </tr>
            <tr v-for="(item,i) in equipmentAccountEntity.spWReportCusVisitEntity">

            <td class="td-value2">
                <input type="text" v-if="pageType=='edit'" style="height: 45px !important;" v-model="item.reportDate" placeholder="选择日期" @focus="showDatePicker($event,'reportDate',item)"/>
                <span v-else class="lineOne">{{item.reportDate}}</span>
            </td>

            <td class="td-value2">
                <input type="text"  v-if="pageType=='edit'" v-model="item.repairOrderNumber" class="openList" :idx="i" @click="changeType('spWReportCusVisitEntity')"/>
                <span v-else class="lineOne">{{item.repairOrderNumber}}</span>
            </td>
            <td class="td-value2">
                <select v-if="pageType=='edit'" type="text" v-model="item.claimType">
                    <option v-for="option in claimType" :value="option.value">{{option.text}}</option>
                </select>
                <span v-else class="lineOne">{{item.claimType}}</span>
            </td>
            <td class="td-value2">
                <input type="text"  v-if="pageType=='edit'" v-model="item.claimSubmissionDate" placeholder="选择日期" @focus="showDatePicker($event,'claimSubmissionDate',item)"/>
                <span v-else class="lineOne">{{item.claimSubmissionDate}}</span>
            </td >

            <td  class="td-value2">
                <input type="text" v-if="pageType=='edit'" v-model="item.claimAmount"/>
                <span v-else class="lineOne">{{item.claimAmount}}</span>
            </td>
            <td  class="td-value2">
                <input type="text" v-if="pageType=='edit'" v-model="item.replyDate" placeholder="选择日期" @focus="showDatePicker($event,'replyDate',item)"/>
                <span v-else class="lineOne">{{item.replyDate}}</span>
            </td>
            <td class="td-value2">
                <input type="text" v-model="item.approvalAmount"  v-if="pageType=='edit'"/>
                <span v-else class="lineOne">{{item.approvalAmount}}</span>
            </td>
            <td class="td-value2">
                <input type="text" v-if="pageType=='edit'" v-model="item.arrivalDate" placeholder="选择日期" @focus="showDatePicker($event,'arrivalDate',item)"/>
                <span v-else class="lineOne" >{{item.arrivalDate}}</span>
            </td>
            <td class="td-value2">
                <input type="text" v-model="item.arrivalAmount" v-if="pageType=='edit'"/>
                <span v-else class="lineOne">{{item.arrivalAmount}}</span>
            </td>
            <td class="td-value2">
                <input type="text" v-model="item.refusalAmount" v-if="pageType=='edit'"/>
                <span v-else class="lineOne">{{item.refusalAmount}}</span>
            </td>
            <td class="td-value2">
                <select v-if="pageType=='edit'" type="text" v-model="item.refusalReason">
                    <option v-for="option in refusalReason" :value="option.value">{{option.text}}</option>
                </select>
                <span v-else class="lineOne">{{item.refusalReason}}</span>
            </td>
            <td class="td-value2">
                <select v-if="pageType=='edit'" type="text" v-model="item.oldCondition">
                    <option v-for="option in oldCondition" :value="option.value">{{option.text}}</option>
                </select>
                <span v-else class="lineOne">{{item.oldCondition}}</span>
            </td>
            <td class="td-value2">
                <input type="text" v-if="pageType=='edit'" v-model="item.returnDate" placeholder="选择日期" @focus="showDatePicker($event,'returnDate',item)"/>
                <span v-else class="lineOne">{{item.returnDate}}</span>
            </td>
                <!--<div v-if="item.attachName" style="float:left;cursor: pointer;width: 80px"-->
                     <!--v-on:click="download(item.attachUrl,item.attachName)">-->
                    <!--<input v-if="item.attachName" type="button" class="IcoNormal"-->
                           <!--style="float:left;margin-top:6px"/>-->
                    <!--<span class="lineOne">{{item.attachName}}</span>-->
                <!--</div>-->
                <!--<div v-else style="float:left;cursor: pointer;"-->
                     <!--v-on:click="download(item.attachUrl,item.attachName)">-->
                    <!--<input v-if="item.attachName" type="button" class="IcoNormal"-->
                           <!--style="float:left;margin-top:6px"/>-->
                    <!--<span class="lineOne">{{item.attachName}}</span>-->
                <!--</div>-->
                <!--<div style="position: absolute;right: 1px;top: 8px;">-->
                <!--<a href="javascript:void(0);" v-if="pageType!='look'&&item.attachName"-->
                <!--class="delfile" v-on:click="deleteFileRP(item,'spWReportCusVisitEntity',i)"><span-->
                <!--style="color: red;font-weight: bold;">X</span></a>-->
                <!--</div>-->
                <!--<div v-if="pageType!='look'&&!item.attachName" :class="pageType=='look'?'fujian fj noFujian':'fujian fj'"-->
                <!--:id="'spWReportCusVisitEntity'+i">上传附件-->
                <!--</div>-->
                <td class="td-row2 td-value1" >
                    <div id="divUploadedFiles2">
                        <div v-for="(attach,index) in item.attaches" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer" v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename" style="float:left;cursor: pointer;width: 80px" v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                            <div class="delfile">
                                <span  v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);" style="color: red;font-weight: bold; !important;" @click="deleteFile5(item,'spWReportCusVisitEntity',i,index)">X</a></span>
                            </div>
                        </div>
                    </div>
                </td>
                <td >
                    <div v-if="pageType!='look'" :id="'spWReportCusVisitEntity'+i" class="rightBorder fj fujian">
                        上传附件
                    </div>
                </td>
        </tr>
        </table>
        <table class="table-detail">
            <tr class="td-module" >
                <td colspan="12">配件销售记录详情
                    <span class="span-a-btn" v-if="pageType=='edit'"><a href="javascript:void(0);" class="a-btn"
                                                @click="addRow('xsWReportCusVisitEntity','equipmentAccountEntity')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('xsWReportCusVisitEntity')">删除一行</a></span>

                </td>
            </tr>
            <tr>
                <td class="td-title" style="width:80px;">出库日期</td>
                <td class="td-title" style="width:85px;">报修单号</td>
                <td class="td-title" style="width:85px;">出库单号</td>
                <td class="td-title" style="width:69px">出库金额(元)</td>
                <td class="td-title" style="width:69px">回款金额(元)</td>
                <td class="td-title" style="width:69px"> 欠款金额(元)</td>
                <td class="td-title" style="width:90px;">预计还款日期</td>
                <td class="td-title" style="width:85px;">责任人</td>
                <td class="td-title" style="width:90px;">实际还款日期</td>
                <td class="td-title" >说明</td>
                <td class="td-title" style="width:110px">附件</td>
                <td class="td-title" style="width:85px"></td>
            </tr>
            <tr v-for="(item,i) in equipmentAccountEntity.xsWReportCusVisitEntity">
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.reportDate" placeholder="选择日期" @focus="showDatePicker($event,'reportDate',item)"/>
                    <span v-else class="lineOne">{{item.reportDate}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.repairOrderNumber" class="openList" :idx="i" @click="changeType('xsWReportCusVisitEntity')"/>
                    <span v-else class="lineOne">{{item.repairOrderNumber}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.numberDelivery"/>
                    <span v-else class="lineOne">{{item.numberDelivery}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.outboundAmount"/>
                    <span v-else class="lineOne">{{item.outboundAmount}}</span>

                </td>
                <td class="td-value2">
                    <input type="text" v-model="item.paymentAmount" v-if="pageType=='edit'"/>
                    <span v-else class="lineOne">{{item.paymentAmount}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-model="item.amountOwed" v-if="pageType=='edit'"/>
                    <span v-else class="lineOne">{{item.amountOwed}}</span>
                </td>
                <td class="td-value2">
                  <input  v-if="pageType=='edit'" v-model="item.estimatedRepaymentDate" type="text" placeholder="选择日期" @focus="showDatePicker($event,'estimatedRepaymentDate',item)"/>
                    <span v-else class="lineOne">{{item.estimatedRepaymentDate}}</span>
                </td>
                <td class="td-value2">
                    <input type="text" v-if="pageType=='edit'" v-model="item.principal" class="txtParentpj" @click="onfocus1(i)" />
                    <span v-else class="lineOne">{{item.principal}}</span>
                </td>
                <td class="td-value2">
                    <input  v-if="pageType=='edit'" type="text" v-model="item.actualRepaymentDate" placeholder="选择日期" @focus="showDatePicker($event,'actualRepaymentDate',item)"/>
                    <span v-else class="lineOne">{{item.actualRepaymentDate}}</span>
                </td>
                <td class="td-value2">
                    <textarea  v-if="pageType=='edit'" v-model="item.description"></textarea>
                    <span v-else class="lineOne">{{item.description}}</span>
                </td>
                <!--<td style="position: relative">-->
                    <!--<div v-if="item.attachName" style="float:left;cursor: pointer;width: 80px"-->
                         <!--v-on:click="download(item.attachUrl,item.attachName)">-->
                        <!--<input v-if="item.attachName" type="button" class="IcoNormal"-->
                               <!--style="float:left;margin-top:6px"/>-->
                        <!--<span class="lineOne">{{item.attachName}}</span>-->
                    <!--</div>-->
                    <!--<div v-else style="float:left;cursor: pointer;"-->
                         <!--v-on:click="download(item.attachUrl,item.attachName)">-->
                        <!--<input v-if="item.attachName" type="button" class="IcoNormal"-->
                               <!--style="float:left;margin-top:6px"/>-->
                        <!--<span class="lineOne">{{item.attachName}}</span>-->
                    <!--</div>-->
                    <!--<div style="position: absolute;right: 1px;top: 8px;">-->
                    <!--<a href="javascript:void(0);" v-if="pageType!='look'&&item.attachName"-->
                    <!--class="delfile" v-on:click="deleteFileRP(item,'xsWReportCusVisitEntity',i)"><span-->
                    <!--style="color: red;font-weight: bold;">X</span></a>-->
                    <!--</div>-->
                    <!--<div v-if="pageType!='look'&&!item.attachName" :class="pageType=='look'?'fujian fj noFujian':'fujian fj'"-->
                    <!--:id="'xsWReportCusVisitEntity'+i">上传附件-->
                    <!--</div>-->
                <!--</td>-->
                <td class="td-row2 td-value1" >
                    <div id="divUploadedFiles">
                        <div v-for="(attach,index) in item.attaches" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer" v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename" style="float:left;cursor: pointer;width: 80px" v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                            <div class="delfile">
                                <span  v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);" style="color: red;font-weight: bold; !important;" @click="deleteFile5(item,'xsWReportCusVisitEntity',i,index)">X</a></span>
                            </div>
                        </div>
                    </div>
                    <div v-if=attaches.length==0&&pageType!='edit'" style="text-align: left;"><span class="sp-value">无</span></div>
                </td>
                <td >
                    <div v-if="pageType!='look'" :id="'xsWReportCusVisitEntity'+i" class="rightBorder fj fujian">
                        上传附件
                    </div>
                </td>
            </tr>
        </table>

    </div>
    <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
        <input type="button" style="margin-left:20px;" value="返回" class="btn oaBtn btn-sm" @click="goBack" >
        <input type="button" style="margin-left:20px;" value="保存" class="btn oaBtn btn-sm" @click="save()" v-if="pageType != 'look'">
    </div>



    <div class="south" style="height:50px;line-height:50px;text-align:center;">

    </div>

</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/js/pages/wreport/Template.js?t=42e28def"></script>
<script>
    $(function () {
        $("body").on("click", ".td-value2", function (e) {
            if(app.pageType=="edit"){return false}
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $(function () {
        $("body").on("click", ".openList", function (e) {
            var idx=$(this).attr("idx");
            app.idx=idx;
            if ($(".selectOption").is(":hidden")) {
                    $(".selectOption").css({
                        "width": $(this).outerWidth() +42+ "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px",
                    }).show();
                    e.stopPropagation();
            } else {
                $(".selectOption").hide();
            }
        });
        $("body").on("click", ".selectOption", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".selectOption").hide();
        });
    });
</script>
<script type="text/javascript">
    function IsPC() {
        var userAgentInfo = navigator.userAgent;
        var Agents = ["Android", "iPhone",
            "SymbianOS", "Windows Phone",
            "iPad", "iPod"];
        var flag = true;
        for (var v = 0; v < Agents.length; v++) {
            if (userAgentInfo.indexOf(Agents[v]) > 0) {
                flag = false;
                break;
            }
        }
        return flag;
    }
    function refresh() {
    }
    var app = new Vue({
            el: '#app',
            data: {
                idx:'',
                entity:'',
                currentfocus: 0,
                deviceSourceList:[
                    {text: '', value: ''},
                    {text: '自销', value: '自销'},
                    {text: '转入', value: '转入'},
                    {text: '转出', value: '转出'}
                    ],
                cooperationType: [
                    {text: '', value: ''},
                    {text: '合作', value: '合作'},
                    {text: '部分合作', value: '部分合作'},
                    {text: '不合作', value: '不合作'}
                ],
                customerType: [
                    {text: '', value: ''},
                    {text: '现结无欠款', value: '现结无欠款'},
                    {text: '现结有欠款', value: '现结有欠款'},
                    {text: '有账期无欠款', value: '有账期无欠款'},
                    {text: '有账期有欠款', value: '有账期有欠款'}
                ],
                warrantState: [
                    {text: '', value: ''},
                    {text: '在保', value: '在保'},
                    {text: '延保', value: '延保'},
                    {text: '出保', value: '出保'}
                ],
                state: [
                    {text: '', value: ''},
                    {text: '已处理', value: '已处理'},
                    {text: '未处理', value: '未处理'},
                ],
                claimType:[
                    {text: '', value: ''},
                    {text: '定检服务费', value: '定检服务费'},
                    {text: '标准索赔', value: '标准索赔'},
                ],
                refusalReason:[
                    {text: '', value: ''},
                    {text: '报告不合格', value: '报告不合格'},
                    {text: '技术原因不索赔', value: '技术原因不索赔'},
                ],
                oldCondition:[
                    {text: '', value: ''},
                    {text: '在库', value: '在库'},
                    {text: '返厂', value: '返厂'},
                    {text: '无', value: '无'},
                ],
                repairOrderNumberList:[],
                workingCondition:[],
                serverVisitType: [],
                pageType: $.wyui.page.urlParams.pageType,
                id:$.wyui.page.urlParams.id,
                equipmentAccountEntity:{
                    deviceInfo:{},
                    fwWReportCusVisitEntity: [
                        new Template.equipmentAccountEntity()
                    ],
                    spWReportCusVisitEntity: [
                        new Template.equipmentAccountEntity()
                    ],
                    xsWReportCusVisitEntity: [
                        new Template.equipmentAccountEntity()
                    ]
                }
            },
            methods: {
                selectP:function(value){
                    var ent=this.entity;
                    this.equipmentAccountEntity[ent][this.idx].repairOrderNumber=value;
                    $(".selectOption").hide();
                    },
                goBack: function () {
                    var pageId = top.getActivePageId();
                    var $iframe = top.findIframeByName("服务台账");
                    /*$iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();*/
                    top.closeTabByPageId(pageId);
                    /*api.close();*/
                },
                onfocus1: function (i) {
                    var that = this;
                    that.currentfocus = i;
                },
                init: function () {
                    var that = this;
                    setTimeout(function () {
                        $(".fj").each(function () {
                            var demo = $(this);
                            var name = demo.attr("id");
                            var nameValue = name + "Name";
                            var uploader = WebUploader.create({
                                // 选完文件后，是否自动上传。
                                auto: true,
                                // swf文件路径
                                swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                                // 文件接收服务端。
                                server: server.fjIp + "/attach/uploadFile.json",
                                // 选择文件的按钮。可选。
                                // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                                pick: '#' + name,
                                duplicate: true
                            });
                            // 文件上传过程中创建进度条实时显示。
                            uploader.on('uploadProgress', function (file, percentage) {
                                var $li = $('#' + file.id),
                                    $percent = $li.find('.progress span');
                                // 避免重复创建
                                if (!$percent.length) {
                                    $percent = $('<p class="progress"><span></span></p>')
                                        .appendTo($li)
                                        .find('span');
                                }
                                $percent.css('width', percentage * 100 + '%');
                            });
                            uploader.on("uploadStart", function () {
                                $("#progress").show();
                            });
                            uploader.on("uploadComplete", function () {
                                $("#progress").hide();
                            });
                            // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                            uploader.on('uploadSuccess', function (file, response) {
                                if (name.substring(0, name.length - 1) == 'fwWReportCusVisitEntity') {
                                    var i = name.substring(name.length - 1, name.length);
                                    that.equipmentAccountEntity.fwWReportCusVisitEntity[i].attaches.push({
                                        id: response.id,
                                        name: response.name,
                                        url: response.url
                                    });
                                } else if (name.substring(0, name.length - 1) == 'spWReportCusVisitEntity') {
                                    var i = name.substring(name.length - 1, name.length);
                                    that.equipmentAccountEntity.spWReportCusVisitEntity[i].attaches.push({
                                        id: response.id,
                                        name: response.name,
                                        url: response.url
                                    });
                                }
                                else if (name.substring(0, name.length - 1) == 'xsWReportCusVisitEntity') {
                                    var i = name.substring(name.length - 1, name.length);
                                    that.equipmentAccountEntity.xsWReportCusVisitEntity[i].attaches.push({
                                        id: response.id,
                                        name: response.name,
                                        url: response.url
                                    });
                                }
                            });
                            // 文件上传失败，显示上传出错。
                            uploader.on('uploadError', function (file) {
                                alert("上传失败！");
                            });
                        });
                    }, 500);

                },
                save:function(){
                    var that=this;
                    $.wyui.postMethod('/equipmentAccount/save.json', trimRN(that.equipmentAccountEntity), function (r) {
                        alert("保存成功");
                       var pageId = top.getActivePageId();
                        top.refreshTabByName("服务台账", "no");
                        // top.closeTabByPageId("fwtz");
                         top.closeTabByPageId(pageId);
                    })
                },
                addRow: function (prop, template) {
                    var that = this;
                    that.equipmentAccountEntity[prop].push(new Template[template]());
                    var i;
                    if (prop=="fwWReportCusVisitEntity") {
                        i= that.equipmentAccountEntity.fwWReportCusVisitEntity.length-1
                    }else if(prop=="spWReportCusVisitEntity"){
                        i= that.equipmentAccountEntity.spWReportCusVisitEntity.length-1
                    }else if(prop=="xsWReportCusVisitEntity"){
                        i= that.equipmentAccountEntity.xsWReportCusVisitEntity.length-1
                    }
                    setTimeout(function () {
                            var name = prop;
                            var uploader = WebUploader.create({
                                // 选完文件后，是否自动上传。
                                auto: true,
                                // swf文件路径
                                swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                                // 文件接收服务端。
                                server: server.fjIp + "/attach/uploadFile.json",
                                // 选择文件的按钮。可选。
                                // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                                pick: '#' + prop+i,
                                duplicate: true
                            });
                            // 文件上传过程中创建进度条实时显示。
                            uploader.on('uploadProgress', function (file, percentage) {
                                var $li = $('#' + file.id),
                                    $percent = $li.find('.progress span');
                                // 避免重复创建
                                if (!$percent.length) {
                                    $percent = $('<p class="progress"><span></span></p>')
                                        .appendTo($li)
                                        .find('span');
                                }
                                $percent.css('width', percentage * 100 + '%');
                            });
                            uploader.on("uploadStart", function () {
                                $("#progress").show();
                            });
                            uploader.on("uploadComplete", function () {
                                $("#progress").hide();
                            });
                            // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                            uploader.on('uploadSuccess', function (file, response) {

                                if (prop== 'fwWReportCusVisitEntity') {
                                    that.equipmentAccountEntity.fwWReportCusVisitEntity[i].attaches.push({
                                        id: response.id,
                                        name: response.name,
                                        url: response.url
                                    });
                                } else if (prop == 'spWReportCusVisitEntity') {
                                    that.equipmentAccountEntity.spWReportCusVisitEntity[i].attaches.push({
                                        id: response.id,
                                        name: response.name,
                                        url: response.url
                                    });
                                }
                                else if (prop== 'xsWReportCusVisitEntity') {
                                    that.equipmentAccountEntity.xsWReportCusVisitEntity[i].attaches.push({
                                        id: response.id,
                                        name: response.name,
                                        url: response.url
                                    });
                                }
                            });
                            // 文件上传失败，显示上传出错。
                            uploader.on('uploadError', function (file) {
                                alert("上传失败！");
                            });
                    }, 500);
                    setTimeout(function () {
                        initAutoComplete();
                        initAutoCompletepj();
                    }, 300);

                },

                changeType:function(entity){
                    this.entity=entity;
                },
                download: function (attachId, fileName) {
                    downloadFile(attachId,fileName)
                    return false;
                },
                delRow: function (prop,index) {
                    this.equipmentAccountEntity[prop].splice(this.equipmentAccountEntity[prop].length - 1, 1);
                },
                /*下载还款计划表附件*/
                downloadRP: function (attachId, fileName, i) {
                    downloadFile(attachId,fileName)
                    return false;
                },
                deleteFile5: function (item, type,i,index) {
                    var that=this;
                    console.log(that.equipmentAccountEntity[type][i]);
                    console.log(type)
                    that.equipmentAccountEntity[type][i].attaches.splice(index, 1);
                    // setTimeout(function () {
                    //     var name = type;
                    //     var uploader = WebUploader.create({
                    //         // 选完文件后，是否自动上传。
                    //         auto: true,
                    //         // swf文件路径
                    //         swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    //         // 文件接收服务端。
                    //         server: server.fjIp + "/attach/uploadFile.json",
                    //         // 选择文件的按钮。可选。
                    //         // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    //         pick: "#" + type+i,
                    //         duplicate: true
                    //     });
                    //     // 文件上传过程中创建进度条实时显示。
                    //     uploader.on('uploadProgress', function (file, percentage) {
                    //         var $li = $('#' + file.id),
                    //             $percent = $li.find('.progress span');
                    //         // 避免重复创建
                    //         if (!$percent.length) {
                    //             $percent = $('<p class="progress"><span></span></p>')
                    //                 .appendTo($li)
                    //                 .find('span');
                    //         }
                    //         $percent.css('width', percentage * 100 + '%');
                    //     });
                    //     uploader.on("uploadStart", function () {
                    //         $("#progress").show();
                    //     });
                    //     uploader.on("uploadComplete", function () {
                    //         $("#progress").hide();
                    //     });
                    //     // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                    //     uploader.on('uploadSuccess', function (file, response) {
                    //
                    //         if (type== 'fwWReportCusVisitEntity') {
                    //             that.equipmentAccountEntity.fwWReportCusVisitEntity[i].attaches.push({
                    //                 id: response.id,
                    //                 name: response.name,
                    //                 url: response.url
                    //             });
                    //         } else if (type == 'spWReportCusVisitEntity') {
                    //             that.equipmentAccountEntity.spWReportCusVisitEntity[i].attaches.push({
                    //                 id: response.id,
                    //                 name: response.name,
                    //                 url: response.url
                    //             });
                    //         }
                    //         else if (type== 'xsWReportCusVisitEntity') {
                    //             that.equipmentAccountEntity.xsWReportCusVisitEntity[i].attaches.push({
                    //                 id: response.id,
                    //                 name: response.name,
                    //                 url: response.url
                    //             });
                    //         }
                    //     });
                    //     // 文件上传失败，显示上传出错。
                    //     uploader.on('uploadError', function (file) {
                    //         alert("上传失败！");
                    //     });
                    // }, 500);
                },
                showDatePicker: function (e,type,item) {
                   var that = this;
                    WdatePicker({
                        onpicked: function (dp) {
                            if(item=='deviceInfo'){
                                that.equipmentAccountEntity.deviceInfo[type]= dp.cal.getNewDateStr();
                            }else {
                                item[type] = dp.cal.getNewDateStr();
                            }
                            return true;
                        }
                    });
                    $(e.target).blur();
                },
            },
            mounted: function () {
                var that = this;
                $.wyui.postMethod('/equipmentAccount/getDeviceById.json', {id:that.id}, function (r) {
                    that.equipmentAccountEntity = r;
                    if (r.fwWReportCusVisitEntity.length==0){
                        that.equipmentAccountEntity.fwWReportCusVisitEntity.push(new Template.equipmentAccountEntity());
                    }
                    if (r.spWReportCusVisitEntity.length==0){
                        that.equipmentAccountEntity.spWReportCusVisitEntity.push(new Template.equipmentAccountEntity());
                    }
                    if (r.xsWReportCusVisitEntity.length==0){
                        that.equipmentAccountEntity.xsWReportCusVisitEntity.push(new Template.equipmentAccountEntity());
                    }
                },true);
                $.wyui.postMethod('/enum2/selectByModuleType.json', {moduleType: 'serviceType'}, function (r) {
                    that.serverVisitType = r;
                })
                $.wyui.postMethod('/enum2/selectByModuleType.json', {moduleType: 'workingCondition'}, function (r) {
                    that.workingCondition = r;
                })
                that.init();
                setTimeout(function () {
                    initAutoComplete();
                    initAutoCompletepj();
                }, 300);
            }
        })
    ;
</script>
<script>
    $(function () {
        initAutoComplete();
        initAutoCompletepj();
    });
    $("#customer").autoComplete({
        url: server.ip + urlConfig.contract.getNameAndTel,
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].customerName + "&nbsp;" +
                    "(" + users[i].customerTel + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.equipmentAccountEntity.deviceInfo.servicePersonnel = user.customerName;
            return false;
        },
        height: 210,
        width: 420
    });
    function initAutoComplete() {
        $(".txtParent").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.equipmentAccountEntity.fwWReportCusVisitEntity[app.currentfocus].principal = r.name;
                return false;
            },
            height: 210,
            width: 300
        });
    }
    function initAutoCompletepj() {
        $(".txtParentpj").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.equipmentAccountEntity.xsWReportCusVisitEntity[app.currentfocus].principal = r.name;
                return false;
            },
            height: 210,
            width: 300
        });
    }

</script>
</body>
</html>